package com.wuliu.system.service.impl;

import java.util.List;
import com.wuliu.common.utils.DateUtils;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;
import com.wuliu.system.mapper.TspLoadingDetailMapper;
import com.wuliu.system.domain.TspLoadingDetail;
import com.wuliu.system.service.ITspLoadingDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 装车明细Service业务层处理
 * 
 * @author realue
 * @date 2023-10-25
 */
@Service
public class TspLoadingDetailServiceImpl extends ServiceImpl<TspLoadingDetailMapper, TspLoadingDetail> implements ITspLoadingDetailService {
    @Resource
    private TspLoadingDetailMapper tspLoadingDetailMapper;

    /**
     * 查询装车明细
     * 
     * @param id 装车明细主键
     * @return 装车明细
     */
    @Override
    public TspLoadingDetail selectTspLoadingDetailById(String id) {
        return tspLoadingDetailMapper.selectTspLoadingDetailById(id);
    }

    /**
     * 查询装车明细列表
     * 
     * @param tspLoadingDetail 装车明细
     * @return 装车明细
     */
    @Override
    public List<TspLoadingDetail> selectTspLoadingDetailList(TspLoadingDetail tspLoadingDetail) {
        return tspLoadingDetailMapper.selectTspLoadingDetailList(tspLoadingDetail);
    }

    /**
     * 新增装车明细
     * 
     * @param tspLoadingDetail 装车明细
     * @return 结果
     */
    @Override
    public int insertTspLoadingDetail(TspLoadingDetail tspLoadingDetail) {
        tspLoadingDetail.setCreateTime(DateUtils.getNowDate());
        return tspLoadingDetailMapper.insertTspLoadingDetail(tspLoadingDetail);
    }

    /**
     * 修改装车明细
     * 
     * @param tspLoadingDetail 装车明细
     * @return 结果
     */
    @Override
    public int updateTspLoadingDetail(TspLoadingDetail tspLoadingDetail) {
        tspLoadingDetail.setUpdateTime(DateUtils.getNowDate());
        return tspLoadingDetailMapper.updateTspLoadingDetail(tspLoadingDetail);
    }

    /**
     * 批量删除装车明细
     * 
     * @param ids 需要删除的装车明细主键
     * @return 结果
     */
    @Override
    public int deleteTspLoadingDetailByIds(String[] ids) {
        return tspLoadingDetailMapper.deleteTspLoadingDetailByIds(ids);
    }

    /**
     * 删除装车明细信息
     * 
     * @param id 装车明细主键
     * @return 结果
     */
    @Override
    public int deleteTspLoadingDetailById(String id) {
        return tspLoadingDetailMapper.deleteTspLoadingDetailById(id);
    }
}
